lines = []
nums = 0
numlist = []

nums = input()
print("numbers:"+str(nums))

numlist = input()
numlist = numlist.split(" ")

# cal match numbers
match_numbers = 0
for i in numlist:
    if int(i[3]) - int(i[0])-int(i[1])-int(i[2]) > 0:
        match_numbers += 1

print("match numbers:" + str(match_numbers))
